class Solution {
    public char firstUniqChar(String s) {
        Map<Character,Boolean> map = new HashMap<>();
        char[] chs = s.toCharArray();
        for(char ch: chs){
            map.put(ch,map.containsKey(ch));
        } 
        for(char ch: chs){
            if(!map.get(ch)) return ch;
        }
        return ' ';
    }
}